<!--_meta 作为公共模版分离出去-->
<#include "include/_meta.html">
<!--/meta 作为公共模版分离出去-->

<title>车辆管理-编辑自用记录</title>
<meta name="keywords" content="汽车租赁">
<meta name="description" content="H-ui.admin v2.3，是一款由国人开发的轻量级扁平化网站后台模板，完全免费开源的网站后台管理系统模版，适合中小型CMS后台系统。">
</head>
<body>
<article class="page-container">
	<form class="form form-horizontal" id="form-selfuse-add" >
	
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>车牌号：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text" autocomplete="off" value="${(selfUse.carid)!''}" placeholder="车牌号" id="carid" name="carid">
		</div>
	</div>
		
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>发车里程：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text" autocomplete="off" value="${(selfUse.initmile?c)!''}" placeholder="发车里程" id="initmile" name="initmile">
		</div>
	</div>

	
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>发车油量：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text" autocomplete="off" value="${(selfUse.initoil?c)!''}" placeholder="发车油量" id="initoil" name="initoil">
		</div>
	</div>
	
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>使用事项</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text" autocomplete="off" value="${(selfUse.noticeitem)!''}" placeholder="使用事项" id="noticeitem" name="noticeitem">
		</div>
	</div>
		


	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>经办人员</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text" autocomplete="off" value="${(selfUse.headman)!''}" placeholder="经办人员" id="headman" name="headman">
		</div>
	</div>			
	
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>经办手机</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text" autocomplete="off" value="${(selfUse.headmobile)!''}" placeholder="经办手机" id="headmobile" name="headmobile">
		</div>
	</div>
	
		<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>出车时间</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text"  class="input-text Wdate" onfocus="WdatePicker({skin:'whyGreen',startDate:'%y-%M-%d %H:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss'})" autocomplete="off" placeholder="出车时间" value="${(selfUse.usecartime)!''}" id="usecartime" name="usecartime">
		</div>
	</div>
		<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>预计还车时间</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text"  class="input-text Wdate" onfocus="WdatePicker({skin:'whyGreen',startDate:'%y-%M-%d %H:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss'})"  autocomplete="off"  placeholder="预计还车时间" value="${(selfUse.predtime)!''}" id="predtime" name="predtime">
		</div>
	</div>
	
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3">车辆归还：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="checkbox" id="finish" name="finish" onchange="onchangefinish()">该车辆已经归还，继续填写还车信息
		</div>
	</div>
<div name="div" id="div" style="display:none">
		<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>还车时间</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text"  class="input-text Wdate" onfocus="WdatePicker({skin:'whyGreen',startDate:'%y-%M-%d %H:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss'})"  autocomplete="off" value="${(selfUse.returntime)!''}" placeholder="还车时间" id="returntime" name="returntime">
		</div>
	</div>
		<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>还车油量</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text" autocomplete="off" value="${selfUse.returnoil}" placeholder="还车油量" id="returnoil name="returnoil">
		</div>
	</div><div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>还车里程</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text" autocomplete="off" value="${selfUse.returnmile}" placeholder="还车里程" id="returnmile" name="returnmile">
		</div>
	</div>
		<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3">备注信息：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<textarea id="remark" name="remark" cols="" rows="" class="textarea"  placeholder="说点什么...100个字符以内" dragonfly="true" value="${(selfUse.remark)!''}" onKeyUp="textarealength(this,100)"></textarea>
			<p class="textarea-numberbar"><em class="textarea-length">0</em>/100</p>
		</div>
	</div>

	
	<div class="row cl">
		<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
			<input class="btn btn-primary radius" type="button" value="&nbsp;&nbsp;提交&nbsp;&nbsp;" onclick="$('#form-selfuse-add').submit()"/>
		</div>
	</div>
</div>	
	</form>
</article>

<!--_footer 作为公共模版分离出去--> 
<#include "include/_footer.html">
<!--/_footer /作为公共模版分离出去--> 

<!--请在下方写此页面业务相关的脚本--> 
<script type="text/javascript">
$(function(){
    $("#finish").change(function(){
        var finish =document.getElementById("finish");
        var finishs=document.getElementById("div");
        if(finish.checked==true){
            finishs.style.display="block";
            }else{
            finishs.style.display="none";
         }
     });

	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	
	$("#form-selfuse-add").validate({
		
		
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		submitHandler:function(form){
			
	   		$.ajax({
	
	            type: 'put', 
				contentType:"application/json", 
	            url: '/selfUse/${selfUse.recordid}',
	            data:JSON.stringify({
		                'carid': $("#carid").val(),               
		                'headman': $("#headman").val(),
		                'headmobile': $("#headmobile").val(),
		                'initmile': $("#initmile").val(),
		                'initoil': $("#initoil").val(),							               								
						'usecartime':$('#usecartime').val(),
						'noticeitem':$('#noticeitem').val(),
						'predtime':$('#predtime').val(),
						'returntime': $('#returntime').val(),
						'returnoil': $('#returnoil').val(),
						'returnmile': $('#returnmile').val(),
						'remark': $("#remark").val(),
																	
						}),
	            success:function(data){ 
	 				console.log('提交成功！');
	 				var index = parent.layer.getFrameIndex(window.name);
					parent.$("#searchRepair").click();
					parent.layer.close(index);
	            }
	
	        });

			
		}
	});
});
</script> 
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>